﻿@using SPCFMedicineInformer.Helpers;
@using SPCFMedicineInformer.Constants;
@{
    var Index = UmbracoNodeHelper.GetSlideshowFolder();
    if (Index != null)
    {
        int ctr = 1;
        <div class="panel">
            <div class="details_wrapper">
			    <div class="details">
                    @foreach (dynamic slide in Index.ChildrenAsList.Where(a => a.GetProperty(UmbracoPropertyName.SHOW_IN_FRONTPAGE).Value == "1"))
                    {
                        string url = slide.GetProperty(UmbracoPropertyName.READ_MORE_LINK).Value;
                        <div class="detail">
							<h2><a href="#">@slide.GetProperty(UmbracoPropertyName.SLIDE_TITLE).Value</a></h2>
                            <div>
                                @Html.Raw(StringUtils.TruncateIfLonger(slide.GetProperty(UmbracoPropertyName.CONTENT).Value, 275))
                            </div>
							<a href="@url" title="Read more" class="more">Read more</a>
						</div>
                        
                    }
                </div>
            </div>
            <div class="paging">
			<div id="numbers"></div>
			    <a href="javascript:void(0);" class="previous" title="Previous" >Previous</a>
			    <a href="javascript:void(0);" class="next" title="Next">Next</a>
		    </div><!-- /paging -->
				
		    <a href="javascript:void(0);" class="play" title="Turn on autoplay">Play</a>
		    <a href="javascript:void(0);" class="pause" title="Turn off autoplay">Pause</a>
        </div>
    
        
    
         <div id="slider-image-frame">
            <div class="backgrounds">
                @foreach (dynamic slide in Index.ChildrenAsList.Where(a => a.GetProperty(UmbracoPropertyName.SHOW_IN_FRONTPAGE).Value == "1"))
                {
                    <div class="item item_@ctr">
                        <img src="@slide.GetProperty(UmbracoPropertyName.IMAGE_URL).Value" alt="Image @ctr" height="320" width="480"/>
                    </div>
                    ctr++;
                }
            </div>
        </div>
    }
}